1. Field of the Invention
The present invention relates generally to memory management, and more particularly, to a method of managing a memory in a computing environment in which a plurality of virtual machines is performed in a physical machine, and an apparatus thereof.
2. Description of the Related Art
A virtual machine monitor (also referred to as a hypervisor, or manager) is software for performing a plurality of virtual machines (also called guest operating systems) in one physical machine (e.g., a device including a Central Processing Unit (CPU) and memory), and provides an independent virtual machine interface to respective virtual machines. The virtual machine monitor serves as a host operating system, whereas the virtual machine itself serves as a guest operating system. A virtualization technology using the virtual machine monitor is generally known in a server environment. In recent years, the virtualization technology has been used for the purpose of security in a mobile environment.
The virtual machine monitor causes virtual machines to separately use one physical machine according to a time-sharing scheme. A virtual machine to which a logically independent “virtual machine interface” is allocated recognizes a time-shared physical machine as a logic device to perform its functions. The virtual machine monitor may have performance isolation and Quality of Service (QoS) according to the time-sharing scheme. More specifically, a CPU and an Input/Output (I/O) interface may be shared by virtual machines according to the time-sharing scheme.
However, it is more difficult to efficiently share memory with virtual machines according to the time-sharing scheme than it is to efficiently share the CPU and the I/O interface. Accordingly, a fixed size of memory is allocated to the virtual machine monitor for each virtual machine. In the following example, there are 4 GB of Random Access Memory (RAM) and two virtual machines. The virtual machine monitor may allocate 2 GB of RAM to each virtual machine. However, a static memory partitioning scheme has following problems.
The performance of the CPU or the I/O interface has significantly been developed, whereas the size of a memory mounted in one physical machine is still restrictive. Accordingly, when using a static memory partitioning policy, the number of virtual machines capable of being simultaneously performed in the physical machine is determined according to the size of the memory.
Due to the problems with the static memory partitioning scheme, there is a need for a new memory partitioning scheme. An operating system uses an unused space in the main memory as a page cache, that is, a cache memory to reduce access of a secondary memory (e.g., NAND flash memory, hard disk) to the utmost. Accordingly, there is a need to dynamically allocate the memory to virtual machines in order to improve the performance of a system (e.g., a smart phone having a physical machine and virtual machines).